package com.zhx.business.entity;

import com.zhx.business.base.BaseEntity;
import lombok.Data;
import org.apache.commons.lang.builder.ReflectionToStringBuilder;

import javax.persistence.Entity;
import java.math.BigDecimal;

import static org.apache.commons.lang.builder.ToStringStyle.MULTI_LINE_STYLE;

/**
 * 订单表
 */
@Data
@Entity(name = "order_t")
public class Order extends BaseEntity {
    //渠道编号
    private String chanId;
    //产品Id
    private String productId;
    //用户编号
    private String chanUserId;
    //订单类型 apply申请  redeem 赎回
    /**
     * @see com.zhx.business.enums.OrderType
     */
    private String orderType;
    //订单状态 int 提交 process 处理中 success 成功 fail 失败
    /**
     * @see com.zhx.business.enums.OrderStatus
     */
    private String orderStatus;
    //外部订单状态 外部公司的订单Id
    private String outOrderId;
    //订单金额
    private BigDecimal amount;
    //备注
    private String memo;

    @Override
    public String toString() {
        return ReflectionToStringBuilder.toString(this,MULTI_LINE_STYLE
        );
    }
}
